package cn.pegasus.teamwork.weixinpay.configure;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import cn.pegasus.teamwork.weixinpay.util.MD5Util;

public class WxPayConfig {
	// appid
	public static String APP_ID = "wx620cf6b8dddd4fb8";
	// JSAPI接口中获取openid，审核后在公众平台开启开发模式后可查看
	public static String APP_SECRET = "99e23b31d6548afe53096abc92f1f63f";
	// 受理商ID，身份标识
	public static String MCH_ID = "1494181972";
	// 商户支付密钥Key，装完整数后，配置得到。
//	public static String KEY = "57adf52a81486f3158bac61b3b82c9ea";
	// 异步回调地址
	public static String NOTIFY_URL = "http://tapi.aizichan.cn/api/v_3/notify.do";
	// 字符编码
	public static String CHARTSET = "UTF-8";
	// 加密方式
	public static String SIGN_TYPE = "MD5";
	// redirect_uri，微信授权重定向地址
	public static String REDIRECT_URI;
	
	static {
		try {
			REDIRECT_URI = URLEncoder.encode("http://tapi.aizichan.cn/api/v_3/pay", CHARTSET);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}
	// 商户支付密钥Key
	public static String KEY=MD5Util.GetMD5Code(APP_ID+APP_SECRET);
}
